import type { FC } from 'react';
import { Form, Input } from 'antd';
import CommonModalForm from '@/components/CommonModalForm';
// const { Option } = Select;

type TProps = {
  visible: boolean;
  confirmLoading: boolean;
  operInfo?: any;
  onSubmit: TAnyFunction;
  onCancel: TAnyFunction;
};

const RenameModal: FC<TProps> = (props) => {
  const { visible, confirmLoading, onCancel, onSubmit } = props;

  const [form] = Form.useForm();

  return (
    <CommonModalForm
      formRef={form}
      visible={visible}
      confirmLoading={confirmLoading}
      okText={'确定'}
      title={'重命名'}
      onSubmit={onSubmit}
      onCancel={onCancel}
      formProps={{
        layout: 'vertical',
        autoComplete: 'off',
      }}
    >
      <Form.Item
        name="name"
        label="页面名称"
        rules={[
          {
            required: true,
            message: '请输入页面名称',
          },
        ]}
      >
        <Input showCount maxLength={20} placeholder="请输入页面名称，长度不超过20个文案" />
      </Form.Item>
    </CommonModalForm>
  );
};

export default RenameModal;
